#include <QMessageBox>
#include <opencv2/opencv.hpp>

#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->pushButton, &QPushButton::clicked, this, &MainWindow::onButtonClick);
}

void MainWindow::onButtonClick()
{
    // QMessageBox::information(this, "提示", "按钮被点击！");
    printf("start\n");
    cv::Mat image = cv::imread("Penguins.jpg");
    cv::resize(image, image, cv::Size(800, 600));
    cv::putText(image, "Hello OpenCV", cv::Point(100, 100), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(0, 255, 0), 2);
    cv::imshow("image", image);
    cv::waitKey(0);
    cv::destroyAllWindows();
}